﻿/*
* This software is the confidential and proprietary
* information of NetBay
* Such confidential information should not be disclosed
* NetBay copyright(c) 2010
*/

#region Using
using System.Collections.Generic;
using NetBay.Core.BusinessEntities;
using Rio.Doc.Business.Repository.Translator;
using Rio.Doc.DataAccess;
#endregion

namespace Rio.Doc.Business.Repository
{
    public class ErpRepository
    //public class OrganizationRepository : OrganizationDer
    {


        /// <summary>
        /// 
        /// </summary>
        /// <param name="p_sConnectorName"></param>
        /// <returns></returns>
        public static NetBay.Core.BusinessEntities.Organization GetOrgaByErpName(string p_sConnectorName)
        {

            return ErpTranslator.TranslateErpConnByName(DA_Erp.GetOrgaByErpName(p_sConnectorName));
        }


        /// <summary>
        /// 
        /// </summary>
        /// <param name="s_lAction"></param>
        /// <param name="s_lOrganizationName"></param>
        /// <param name="s_lCodeCourrierGenesis"></param>
        /// <param name="s_lImageName"></param>
        /// <returns></returns>
        public static List<NetBay.Core.BusinessEntities.Genesis> GetGenesisFolder(string p_sConnectorName)
        {
            return ErpTranslator.TranslateGenesis(DA_Erp.GetGenesisFolder(p_sConnectorName));
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="p_sValue"></param>
        /// <param name="p_iOrga"></param>
        /// <param name="p_iTd"></param>
        /// <returns></returns>
        public static string GetErpParam(string p_sValue, int p_iOrga, int p_iTd)
        {

            return ErpTranslator.TranslateParamValeur(DA_Erp.GetErpParam(p_sValue, p_iOrga, p_iTd));



        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="s_lTdTableName"></param>
        /// <param name="s_lIndividu"></param>
        /// <param name="s_lIndexPosit"></param>
        /// <returns></returns>
        public static bool GetGenesisIndividuExist(string s_lTdTableName, string s_lIndividu, string s_lIndexPosit)
        {


            return ErpTranslator.TranslateReturnIndividu(DA_Erp.GetGenesisIndividuExist(s_lTdTableName, s_lIndividu, s_lIndexPosit));
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="s_lCourrierIdErp"></param>
        /// <param name="s_lTdTableName"></param>
        /// <param name="s_lIndividu"></param>
        /// <param name="s_lIndexPosit"></param>
        /// <returns></returns>
        public static bool GetGenesisCourrierIdExist(string s_lCourrierIdErp, string s_lTdTableName, string s_lIndividu, string s_lIndexPosit)
        {


            return ErpTranslator.TranslateReturnCourrierId(DA_Erp.GetGenesisFolderExist(s_lCourrierIdErp, s_lTdTableName, s_lIndividu, s_lIndexPosit));
        }

    }
}
